{include file="public/head" /}
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>后台管理</cite></a>
        <a><cite>物业管理系统</cite></a>
        <a><cite>小区配置</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="javascript:location.reload()" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so"  method="get" action="#">
          <input class="layui-input" placeholder="小区名称" name="community_name" id="community_name" {if isset($community_name)}value="{$community_name}"{/if}>
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <xblock>
        
        <span class="x-right" style="line-height:40px">共有数据：{$number} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th style="text-align: center; font-size: 16px;">小区名称</th>
            <th style="text-align: center; font-size: 16px;">楼栋数量</th>
            <th style="text-align: center; font-size: 16px;">微信商户ID</th>
            <th style="text-align: center; font-size: 16px;">水费单价</th>
            <th style="text-align: center; font-size: 16px;">电费单价</th>
            <th style="text-align: center; font-size: 16px;">支付宝缴费</th>
            <th style="text-align: center; font-size: 16px;">微信缴费</th>
            <th style="text-align: center; font-size: 16px;">是否自动推票</th>
            {if $Think.session.usertype=='0'}
            <th style="text-align: center; font-size: 16px;">是否跳转V3</th>
            <th style="text-align: center; font-size: 16px;">是否跳转直付通</th>
             <th style="text-align: center; font-size: 16px;">小区排序</th>
            {/if}
            <th style="text-align: center; font-size: 16px;">操作</th>
            <th style="text-align: center; font-size: 16px;">小区管理员</th>
          </tr>
        </thead>
        <tbody>
          {foreach $list as $val}
          <tr>
            <td style="text-align: center;">{$val.community_name}</td>
          
            <td style="text-align: center;">{$val.building_num}</td>
            <td style="text-align: center;">{$val.sub_mch_id}</td>
            <td style="text-align: center;">{$val.water}元/吨</td>
            <td style="text-align: center;">{$val.electric}元/度</td>
            
            <td style="text-align: center;">
                {if $val.is_support_alipay=='1'}开启{/if}
                {if $val.is_support_alipay=='0'}<span style="color:red">关闭</span>{/if}
            </td>
            <td style="text-align: center;">
                {if $val.is_support_wechat=='1'}开启{/if}
                {if $val.is_support_wechat=='0'}<span style="color:red">关闭</span>{/if}
            </td>
            <td style="text-align: center;">
              {if $val.auto_invoice_send_status=='1'}是{/if}
              {if $val.auto_invoice_send_status=='2'}<span style="color:red">否</span>{/if}
            </td>
            {if $Think.session.usertype=='0'}
            <td style="text-align: center;">
              {if $val.auto_jump_v3=='1'}是{/if}
              {if $val.auto_jump_v3=='0'}<span style="color:red">否</span>{/if}
            </td>
            <td style="text-align: center;">
              {if $val.auto_jump_zftpay=='1'}是{/if}
              {if $val.auto_jump_zftpay=='0'}<span style="color:red">否</span>{/if}
            </td>
            <td style="text-align: center;">{$val.sort}</td>
            {/if}
            <td class="td-manage" style="text-align: center;">
              
              <a title="配置打印机"  onclick="x_admin_show('配置打印机','{:url('admin/community/printing')}?id={$val.id}',600,500)" href="javascript:;">
                <i class="layui-icon">&#xe614;</i>
              </a>
              <a onclick="payurl('{$val.id}')" title="缴费链接" href="javascript:;">
                  <i class="layui-icon">&#xe628;</i>
              </a>
              {if $Think.session.usertype=='0'}
              <a title="小区排序"  onclick="x_admin_show('小区排序','{:url('admin/community/psort')}?id={$val.id}',600,500)" href="javascript:;">
                <img src="static/index/images/psort.png" style="width:12px;height:12px"/>
              </a>
              <a title="账单设置"  onclick="x_admin_show('账单设置','{:url('billset')}?id={$val.id}',600,500)" href="javascript:;">
                <img src="static/index/images/bill.png" style="width:16px;height:16px"/>
              </a>
               {/if}
            </td>
            <td style="text-align: center;">
              <a title="添加管理员"  onclick="x_admin_show('添加','{:url(\'wxuseradd\')}?id={$val.id}',800,600)" class="layui-btn">
               添加
              </a>

              <a title="添加管理员"  onclick="x_admin_show('列表','{:url(\'wxuserlist\')}?community_id={$val.community_id}',800,600)" class="layui-btn">
                列表
              </a>
            </td>
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="page">
        <div>
        </div>
      </div>

    </div>
    <script>
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
      });
      function payurl(id){
        layer.open({
          type: 1,
          skin: 'x-right', //样式类名
          closeBtn: 0, //不显示关闭按钮
          anim: 2,
          shadeClose: true, //开启遮罩关闭
          area: ['80%', '300px'],
          content: 
          '<div style="padding: 20px 100px; font-size:18px">'+
          '收银台收款：http://www.wuye.zfbzhsq.com/admin/h5alipay/cashierpay?community_id='+ id + '<br><br>'+
          '物业缴费：http://www.wuye.zfbzhsq.com/admin/h5pay/selectroom?community_id='+ id + '<br><br>'+
         '物业缴费2：http://www.wuye.zfbzhsq.com/admin/h5pay/selectroom2?community_id='+ id + '<br><br>'+
          '直付通链接：https://www.zaozaopay.com/zftpay/index/selectroom?community_id='+ id + '<br><br>'+
          '</div>'
        });
      }
      //二维码
      function twocode(url){
              layer.open({
              type: 2,
              title: '二维码',
              shadeClose: true,
              shade: 0.8,
              area: ['30%', '70%'],
              content: url //iframe的url
            });
      }
      //同步小区
      function synchronization(id) {
          var url = '{:url("admin/community/synchronization")}'
          $.post(url, {id: id}, function(r){
              if (r.info) {
                alert(r.info)
                location.reload()
              }else{
                alert(r.error)
                location.reload()  
              }
          })
        }

        function updateCommunityId($id){
            var url = '{:url("admin/community/updateCommunityId")}'
            $.post(url, {id: id}, function(r){
              if (r.info) {
                alert(r.info)
                location.reload()
              }else{
                alert(r.error)
                location.reload()  
              }
            })
        }
      //初始化小区
      function initialize(id){
          var url = '{:url("admin/community/initialize")}'
          $.post(url, {id: id}, function(r){
              if (r.info) {
                alert(r.info)
                location.reload()
              }else{
                alert(r.error)
                location.reload()  
              }
          }) 
      }
      //申请上线
      function basicservice(id){
          var url = '{:url("admin/community/basicservice")}'
          $.post(url, {id: id}, function(r){
              console.log(r);
              if (r.info) {
                alert(r.info)
                location.reload()  
              }else{
                alert(r.error)
                location.reload()  
              }
          })
      }
      
    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>


  </body>

</html>